<?php
namespace Core\CoreContracts;
/*
* Task class definition
*/
class Task {

	/**
    * @property integer $Id The task unique identifier
    */
	public $Id;
	
	/**
    * @property integer $State The task state
    */
	public $State;
	
	/**
    * @property string $Name The task name
    */
	public $Name;
	
	/**
    * @property string $Description The task description
    */
	public $Description;
	
	/**
    * @property User $AffectedUser The affected user
    */
	public $AffectedUser;
	
	/**
    * @property datetime $ModificationDate The modification date 
    */
	public $ModificationDate;
	
	/**
    * @property datetime $CreationDate The creation date 
    */
	public $CreationDate;
	
	/**
	* The default constructor
	*/
	public function __construct()  {  }
	
	/*
	* Build a new user object
	*
	* @param string $name The task name
	* @param User $user The affected user
	*/
	public static function Create($name, $user)
	{
		$task = new Task();
		$task->State = 0;
		$task->Name = $name;
		$task->Description = $name;
		$task->AffectedUser = $user;
		$task->ModificationDate = date("Y-m-d H:i:s");
		$task->CreationDate = date("Y-m-d H:i:s");
		return $task ;
	}
}
?> 